using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;

namespace HB.CacheDb
{
    public interface ICacheDbCallBack
    {
        /// <summary>
        ///如果对象中含有数据库自增列，应将在返回前为引用对象赋值自增属性
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="value"></param>
        /// <returns></returns>
        bool Add<T>(T value);
        /// <summary>
        /// 如果对象中含有数据库自增列，应将在返回前为引用对象赋值自增属性
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="datas"></param>
        /// <returns></returns>
        bool AddAll<T>(List<T> datas);
        bool Update<T>(T obj);
        bool UpdateAll<T>(List<T> datas);
        bool Delete<T>(Expression<Func<T, bool>> ex) where T : class, new();
    }
}
